package com.example.reactandroid;

import java.net.URISyntaxException;

import io.socket.client.IO;
import io.socket.client.Socket;

/**
 * Created by Administrator on 2017/10/11.
 */

public class SingletonSocket {

    private static Socket mSingSocket;

    public  static Socket getSocket(){
        if(mSingSocket == null){
            try {
                //1.初始化socket.io，设置链接
                mSingSocket = IO.socket("http://192.168.0.240:9001");

            } catch (URISyntaxException e) {

            }
        }
        return mSingSocket;
    }
}
